﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Data;

/// <summary>
/// Summary description for servicio
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class tipousuario : System.Web.Services.WebService
{

    TipoUsuarioServices TipoUsuariosServices = new TipoUsuarioServices();

    public tipousuario()
    {
        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    [System.Web.Script.Services.ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]
    public DataSet traerTipoUsuario()
    {
        return TipoUsuariosServices.ObtenerTiposDeUsuarios();




        //List<TipoUsuarioDTO> tipos = new List<TipoUsuarioDTO>();
        //DataSet ds = TipoUsuariosServices.ObtenerTiposDeUsuarios();

        //if (ds.Tables.Count > 0)
        //{
        //    foreach (DataRow row in ds.Tables[0].Rows)
        //    {
        //        TipoUsuarioDTO dto = new TipoUsuarioDTO(row);
        //        tipos.Add(dto);
        //    }
        //}
        
        //return tipos;
    }
}
